package lab03.test01;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Test01 {

        public static void main(String[] args) throws IOException {

            File sc=new File("D:\\word.txt");
            System.out.println("文件名："+sc.getName());
            System.out.println("路径："+sc.getParentFile());
            System.out.println("绝对路径："+sc.getAbsoluteFile());
            System.out.println("绝对路径："+sc.getAbsolutePath());


            BufferedReader br=new BufferedReader(new FileReader(sc));

            System.out.println("文件内容：");


            String s=br.readLine();
            int i=0;
            while (s!=null) {
                System.out.println(s);
                s=br.readLine();
            }
            br.close();

        }
    }
